//
//  WYCommentMeCell.m
//  Boss
//
//  Created by admin on 2018/8/22.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYCommentMeCell.h"
@interface WYCommentMeCell()

@property (strong, nonatomic) IBOutlet UIImageView *userImageView;
@property (strong, nonatomic) IBOutlet UILabel *userNameLabel;
@property (strong, nonatomic) IBOutlet UILabel *timeLabel;

@property (strong, nonatomic) IBOutlet UILabel *contentLabel;
@property (strong, nonatomic) IBOutlet UILabel *messageLabel;
@property (strong, nonatomic) IBOutlet UIImageView *vipImageView;

@end
@implementation WYCommentMeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.userImageView setCornerRadius:20.f];
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setFoeward:(WYForwardModel *)foeward
{
    _foeward = foeward;
    [self.userImageView sd_setImageWithURL:[NSURL URLWithString:foeward.userUrl] placeholderImage:[UIImage imageNamed:@"ic_defult_avatar"]];
    self.userNameLabel.text = foeward.userName;
    self.timeLabel.text = foeward.createTime;
    self.messageLabel.text = foeward.redpacketContent;
    self.contentLabel.text = @"转发了你的红包信息";
    [self.vipImageView showVipImageViewStatusWithVipId:foeward.vipId];
    
    
}
-(void)setComment:(WYForwardModel *)comment
{
    _comment = comment;
    
    [self.userImageView sd_setImageWithURL:[NSURL URLWithString:comment.url] placeholderImage:[UIImage imageNamed:@"ic_defult_avatar"]];
    self.userNameLabel.text = comment.userName;
    self.timeLabel.text = [NSString compareTimeWithBossTime:comment.createTime];
    self.messageLabel.text = comment.redpacketContent;
    
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"回复了你：%@",comment.content]];
     [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor hexStringToColor:@"#466db0" alpha:1.0] range:NSMakeRange(0, 5)];
    self.contentLabel.attributedText = attributedString;
    [self.vipImageView showVipImageViewStatusWithVipId:comment.vipId];
}



@end
